<%@ page contentType="text/html;charset=UTF-8" language="java"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<head>
<base href="<%=basePath%>">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Mua~亲亲宠管理平台</title>
<!-- Bootstrap core CSS-->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template-->
<link href="vendor/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<!-- Custom styles for this template-->
<link href="css/sb-admin.css" rel="stylesheet">
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin.min.js"></script>
<!-- Custom scripts for this page-->
<script src="js/sb-admin-datatables.min.js"></script>
</head>

<body>
	<!-- Navigation-->
	<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"
		id="mainNav">
		<span class="navbar-brand">亲亲宠管理平台</span>
		<button class="navbar-toggler navbar-toggler-right" type="button"
			data-toggle="collapse" data-target="#navbarResponsive"
			aria-controls="navbarResponsive" aria-expanded="false"
			aria-label="Toggle navigation">
			<span class="navbar-toggler-icon"></span>
		</button>
		<div class="collapse navbar-collapse" id="navbarResponsive">
			<ul class="navbar-nav navbar-sidenav" id="exampleAccordion">
				<li class="nav-item breadcrumb" data-code="index"
					data-toggle="tooltip" data-placement="right" title="Dashboard">
					<a class="nav-link " id="index"> <i class="fa fa-fw fa-home"></i>
						<span class="nav-link-text">首页</span> </a></li>
				<li class="nav-item" data-code="petmanage" data-toggle="tooltip"
					data-placement="right" title="Dashboard"><a class="nav-link"
					id="petmanage"> <i class="fa fa-fw fa-gitlab"></i> <span
						class="nav-link-text">商品管理</span> </a></li>
				<li class="nav-item" data-code="petcategorymanage"
					data-toggle="tooltip" data-placement="right" title="Charts"><a
					class="nav-link"> <i class="fa fa-fw fa-cubes"></i> <span
						class="nav-link-text">宠物类别管理</span> </a></li>
				<li class="nav-item" data-code="ordermanage" data-toggle="tooltip"
					data-placement="right" title="Tables"><a class="nav-link">
						<i class="fa fa-fw fa-th-list"></i> <span class="nav-link-text">订单管理</span>
				</a></li>
				<li class="nav-item" data-code="usermanage" data-toggle="tooltip"
					data-placement="right" title="Dashboard"><a class="nav-link">
						<i class="fa fa-fw fa-user"></i> <span class="nav-link-text">用户管理</span>
				</a></li>
				<li class="nav-item" data-code="modifypassword"
					data-toggle="tooltip" data-placement="right" title="Dashboard">
					<a class="nav-link"> <i class="fa fa-fw fa-key"></i> <span
						class="nav-link-text">修改密码</span> </a></li>
			</ul>
			<ul class="navbar-nav ml-auto">
				<li class="nav-item"><a class="nav-link" data-toggle="modal"
					data-target="#logoutdiv"> <i class="fa fa-fw fa-power-off"></i>退出</a>
				</li>
			</ul>
		</div>
	</nav>
	<div class="content-wrapper">
		<div class="container-fluid" id="contenttab">
			<%--<iframe name="mycontent" id="mycontent" src="/admin/index.do" style="border: hidden;height: 1060px;width: 100%;"--%>
			<%--scrolling="no"></iframe>--%>
		</div>
		<footer class="sticky-footer">
			<div class="container">
				<div class="text-center">
					<small>Copyright © miao7niang 软工1班</small>
				</div>
			</div>
		</footer>
		<!-- Scroll to Top Button-->
		<a class="scroll-to-top rounded" href="#page-top"> <i
			class="fa fa-angle-up"></i> </a>
		<!-- Logout Modal-->
		<div class="modal fade" id="logoutdiv" tabindex="-1" role="dialog"
			aria-labelledby="exampleModalLabel" aria-hidden="true">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title" id="exampleModalLabel">确认注销 ？</h5>
						<button class="close" type="button" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">×</span>
						</button>
					</div>
					<div class="modal-footer">
						<button class="btn btn-secondary" type="button"
							data-dismiss="modal">取消</button>
						<a class="btn btn-primary" href="logout.do">确认</a>
					</div>
				</div>
			</div>
		</div>

	</div>
</body>
<script type="text/javascript">
	$(function() {
		$.ajax({
			url : "admin/index.do",
			type : "get",
			dataType : "html",
			success : function(data) {
				$("#contenttab").html(data);
			}
		});
	});
	$(".navbar-nav li").click(
			function() {
				if (!$(this).hasClass("selected")) {
					$(this).addClass("selected").siblings().removeClass(
							"selected");
					$(this).addClass("breadcrumb").siblings().removeClass(
							"breadcrumb");
					var code = $(this).attr("data-code");
					$(".navbar-nav li").each(
							function() {
								$(this).find("img").attr(
										"src",
										"images/" + $(this).attr("data-code")
												+ ".png");
							});
					$(this).find("img").attr("src",
							"images/" + $(this).attr("data-icon") + ".png");
					$.ajax({
						url : 'admin/' + code + ".do",
						type : "get",
						dataType : "html",
						success : function(data) {
							$("#contenttab").html(data);
						}
					});
				}
			});
</script>

</html>
